package ezXpns.tests;

import static org.junit.Assert.*;

import org.junit.Test;

import ezXpns.Report;


//@author A0086934R
public class ReportTest {

	@Test
	public void testConstructor() {
		Report rep1 = new Report();
		
		assertNotNull(rep1);
		
		assertTrue(rep1.getTotalExpense() == 0);
		assertTrue(rep1.getTotalIncome() == 0);
	}
	
	@Test
	public void testChange() {
		Report rep2 = new Report();

		assertTrue(rep2.getTotalExpense() == 0);
		assertTrue(rep2.getTotalIncome() == 0);
		
		rep2.changeExpense((float) 1);
		rep2.changeIncome((float) 1);

		assertTrue(rep2.getTotalExpense() == 1);
		assertTrue(rep2.getTotalIncome() == 1);
		
		rep2.changeExpense((float) -2);
		rep2.changeIncome((float) -2);

		assertTrue(rep2.getTotalExpense() == -1);
		assertTrue(rep2.getTotalIncome() == -1);
		
		rep2.reset();

		assertTrue(rep2.getTotalExpense() == 0);
		assertTrue(rep2.getTotalIncome() == 0);
	}

}
